package com.isatechindonesia.isatracker.receiver;

import com.isatechindonesia.isatracker.DBClass;
import com.isatechindonesia.isatracker.MainActivity;
import com.isatechindonesia.isatracker.service.GPSLoggerService;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class BootCompleted extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		// TODO Auto-generated method stub
		if (intent.getAction().equalsIgnoreCase(Intent.ACTION_BOOT_COMPLETED)) {
			
			// here we start the service
			Intent serviceIntent = new Intent(context,
					GPSLoggerService.class);
			
			//SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);
			//String idgps = pref.getString("idgps", "0000");		
			
			//if (!idgps.equals("0000") && !idgps.isEmpty())
				context.startService(serviceIntent);
		}
	}

}
